package com.situ.day13;

import java.awt.BorderLayout;
import java.awt.GridLayout;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;

public class YunDong {
public static void main(String[] args) {
	JFrame jf = new JFrame();  //新建
	jf.setTitle("测试");		  //窗口名
	jf.setSize(400, 400);	//窗口
	jf.setLocation(500, 300);//位置从左上开始
	jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//设置默认退出操作
	jf.setVisible(true);//把窗口显示在屏幕上
//	jf.setResizable(false);//固定窗口大小，禁止拖拽
	
	JPanel panel = new JPanel();
	jf.add(panel);
	
	//布局
	panel.setLayout(new GridLayout(3,1));
	//复选框
	JPanel sportPanel = new JPanel();
	JLabel sportLabel = new JLabel("你最喜欢的运动");
	JCheckBox checkBox1 = new JCheckBox("足球");
	JCheckBox checkBox2 = new JCheckBox("篮球");
	JCheckBox checkBox3 = new JCheckBox("网球");
	sportPanel.add(sportLabel);
	sportPanel.add(checkBox1);
	sportPanel.add(checkBox2);
	sportPanel.add(checkBox3);
	panel.add(sportPanel);
	//性别选择
	JPanel xiangbiePanel = new JPanel();
	JLabel xiangbieLabel = new JLabel("性别");
	JRadioButton manadioButton = new JRadioButton("男");
	JRadioButton womandioButton = new JRadioButton("女");
	xiangbiePanel.add(xiangbieLabel);
	xiangbiePanel.add(manadioButton);
	xiangbiePanel.add(womandioButton);
	panel.add(xiangbiePanel);
	ButtonGroup buttonGroup = new ButtonGroup();
	buttonGroup.add(manadioButton);
	buttonGroup.add(womandioButton);
	//登陆，取消
	JPanel dengluPanel = new JPanel();
	JButton zhuceButter = new JButton("注册");
	JButton quxiaoButter = new JButton("取消");
	dengluPanel.add(zhuceButter);
	dengluPanel.add(quxiaoButter);
	panel.add(dengluPanel);
	
}
}
